import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/home.vue'
import Index from '@/views/index.vue'
import Register from '@/views/register.vue'
import Login from '@/views/login.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {path:'/',redirect:'/home/index'},
    {
      path: '/home',
      name: 'home',
      component:Home,
      children:[{
        path:'index',
        name:'index',
        component:Index,
      },]
    },
    {
      path:'/register',
      name:'register',
      component:Register,
    },
    {
      path:'/login',
      name:'login',
      component:Login,
    }
    
  ],
})

export default router
